package router;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 
 * @author zgy
 *
 */
@Controller
@RequestMapping(value = "transactionRouter")
public class TransactionRouter {

	private static Logger logger = Logger.getLogger(TransactionRouter.class);

	@RequestMapping
	public String router(@RequestParam("funcID") String funcID) {
		
		if(funcID.equals("0001")) {
			
			logger.info("[transactionRouter]" + funcID + " 商品类目下发");
			return "forward:transaction/queryCommodity";
		} else if(funcID.equals("0002")) {
			
			logger.info("[transactionRouter]" + funcID + " 用户地址选择");
			return "forward:transaction/queryTradeAddr";
		} else if(funcID.equals("0003")) {
			
			logger.info("[transactionRouter]" + funcID + " 订单提交");
			return "forward:transaction/commitTransaction";
		} else if(funcID.equals("0004")) {
			
			logger.info("[transactionRouter]" + funcID + " 订单查询");
			return "forward:transaction/queryTransaction";
		} else if(funcID.equals("0005")) {
			
			logger.info("[transactionRouter]" + funcID + " 交易明细");
			return "forward:transaction/queryTransactionDetails";
		} else if(funcID.equals("0006")) {
			
			logger.info("[transactionRouter]" + funcID + " 流程跟踪");
			return "forward:transaction/queryTransactionLog";
		} else if(funcID.equals("0007")) {
			
			logger.info("[transactionRouter]" + funcID + " 个人中心");
			return "forward:transaction/queryUserCenter";			  
		} else if(funcID.equals("0008")) {
			
			logger.info("[transactionRouter]" + funcID + " 订单修改");
			return "forward:transaction/updateTrade";			  
		} else if(funcID.equals("0009")) {
			
			logger.info("[transactionRouter]" + funcID + " 新增地址");
			return "forward:transaction/addTradeAddr";			  
		} else if(funcID.equals("0010")) {
			
			logger.info("[transactionRouter]" + funcID + " 修改地址");
			return "forward:transaction/updateTradeAddr";			  
		} else if(funcID.equals("0011")) {
			
			logger.info("[transactionRouter]" + funcID + " 删除地址");
			return "forward:transaction/deleteTradeAddr";			  
		}else if(funcID.equals("0012")) {
			
			logger.info("[transactionRouter]" + funcID + " 订单完成列表");
			return "forward:transaction/completeTrade";			  
		} else if(funcID.equals("0013")) {
			
			logger.info("[transactionRouter]" + funcID + " 账户充值");
			return "forward:transaction/accountRecharge";			  
		} else if(funcID.equals("0014")) {
			
			logger.info("[transactionRouter]" + funcID + " 取消订单");
			return "forward:transaction/cancelTrade";			  
		} else if(funcID.equals("0015")) {
			
			logger.info("[transactionRouter]" + funcID + " 用户注册验证");
			return "forward:transaction/isUserRegistered";			  
		} else if(funcID.equals("0016")) {
			
			logger.info("[transactionRouter]" + funcID + " 获取微信openid");
			return "forward:transaction/getOpenID";			  
		} else if(funcID.equals("0017")) {
			
			logger.info("[transactionRouter]" + funcID + " 微信支付");
			return "forward:transaction/wxPayApi";			  
		} else if(funcID.equals("0018")) {
			logger.info("[transactionRouter]" + funcID + " 微信支付状态查询");
			return "forward:transaction/wxPayStatus";			  
		}else if(funcID.equals("0019")) {
			
			logger.info("[transactionRouter]" + funcID + " 邮宝支付");
			return "forward:transaction/ybPayApi";			  
		}else if(funcID.equals("0020")) {
			
			logger.info("[transactionRouter]" + funcID + " 收入明细");
			return "forward:transaction/incomeList";			  
		}else if(funcID.equals("0021")) {
			
			logger.info("[transactionRouter]" + funcID + " 支出明细");
			return "forward:transaction/userBillList";			  
		}else if(funcID.equals("0021")) {
			
			logger.info("[transactionRouter]" + funcID + " ");
			return "forward:transaction/userBillList";			  
		}else {
			logger.info("no such funcID existed");
			return "forward:error";
		}
	}
}